//
//  GSDKCommonMethod.h
//  GameSDK
//
//  Created by Johnny on 2017/7/28.
//  Copyright © 2017年 Johnny. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MBProgressHUD.h"
#import "GSDKSaveKey.h"
#import "GSDKUserAccountModel.h"
#import "GSDKUserViewController.h"
#import "NSString+Extension.h"
#import "GSDKMessagePopView.h"
#import "GSDKResponseModel.h"
#import "GSDKComplatformBase.h"
#define windowWidth ([UIScreen mainScreen].bounds.size.width)
#define windowHeight ([UIScreen mainScreen].bounds.size.height)

#define IS_VERSION_IOS6 [[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0
#define IS_VERSION_IOS7 [[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0
#define IS_VERSION_IOS8 [[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0
#define IS_VERSION_IOS9 [[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0
#define IS_VERSION_DOWN_IOS8 [[[UIDevice currentDevice] systemVersion] floatValue] < 8.0

#define iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)

#define RGB_Color(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]

//测试,发布要改成release版本

#if __IPHONE_OS_VERSION_MIN_REQUIRED < 40000
#define DEBUGMSG(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#define RMStoreLog(...) DEBUGMSG(@"RMStore: %@", [NSString stringWithFormat:__VA_ARGS__]);
#else
#define DEBUGMSG(msg,...)
#define RMStoreLog(...)
#endif

#define GSDKCOMMONMETHOD [GSDKCommonMethod shared]
@interface GSDKCommonMethod : NSObject
@property (nonatomic, copy) NSString * GSDKCid;                         //渠道id
@property (nonatomic, copy) NSString * GSDKSid;                         //服务器id
@property (nonatomic, copy) NSString * GSDKToken;                       //设备码
@property (nonatomic, copy) NSString * GSDKType;                        //设备类型
@property (nonatomic, copy) NSString * GSDKDeviceNo;                    //user标识
@property (nonatomic, copy) NSString * privateKey;                      //游戏私有key

@property (nonatomic, copy) NSString * WXAppId;                         //游戏私有key
@property (nonatomic, copy) NSString * WXsecret;                      //游戏私有key

@property (nonatomic, retain) MBProgressHUD * hud;
@property (nonatomic) int msgBadgeNum;                                  //登录成功后的上部弹出框提示

@property (nonatomic, strong) GSDKUserAccountModel * accountModel;      //登录号的用户model

@property (nonatomic, strong) GSDKUserViewController * userVc;          //用户界面

@property (nonatomic, strong) GSDKResMenuModel * menuModel;             //配置文件

@property (nonatomic, strong) GSDKResGameVersionModel * versionModel;   //版本

@property (nonatomic, strong) UIViewController * rootViewController;

@property (nonatomic, strong) NSDictionary *game_ext;

@property (nonatomic) _GSDK_LANGUAGE language;

+ (GSDKCommonMethod *)shared;

/**
 获取屏幕方向
 
 @return 1、2是竖屏，3、4是横屏
 */
+ (int)returnOrientation;

/**
 获取屏幕高度
 
 @return 屏幕高度
 */
+ (CGFloat )getHight;

/**
 获取屏幕宽度
 
 @return 屏幕宽度
 */
+ (CGFloat )getWidth;

/**
 保存唯一标识符
 
 @param deviceID 唯一标识符
 */
+ (void)saveDeviceID:(NSString *)deviceID;

/**
 获取唯一标识符
 
 @return 唯一标识符
 */
+ (NSString *)getDeviceID;

/**
 获取设备信息
 
 @return 设备信息
 */
+ (NSString *)getDeviceMSG;

- (void)online;

- (NSString *)generateSignKey:(NSString *) keyString;
@end
